package com.fbee.smartcommunities.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fbee.smartcommunities.core.Base;
import java.io.Serializable;
import java.util.List;

import lombok.*;

/**
 * <p>
 * 商品分类
 * </p>
 *
 * @author 汪佳泉
 * @since 2024-08-18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Category extends Base {

    private static final long serialVersionUID = 1L;

    /**
     * 分类名称
     */
    private String name;

    /**
     * 父类id
     */
    private Long parentId;

    /**
     * 目录类型
     */
    private Integer type;

    /**
     * 目录层级
     */
    private Integer level;

    /**
     * 分类图标 可为空
     */
    private String icon;

    @TableField(exist = false) // 表明这个字段不是数据库表中的字段
    private List<Category> children;

    public Category(String name, Long parentId, Integer type, Integer level,String icon) {
        this.name = name;
        this.parentId = parentId;
        this.type = type;
        this.level = level;
        this.icon = icon;
    }
}
